﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using FwProject.Comm.ExcelUtil;
using X.PagedList;

namespace FwProject.Distribution.Dto.Statistics
{
    /// <summary>
    /// 司机实送率
    /// </summary>
    [DisplayName(displayName: "司机实送率统计")]
    public class DriverActualRatioOutputDto
    {
        ///// <summary>
        ///// 司机名称
        ///// </summary>
        //[DisplayName(displayName:"配送司机")]
        //[ExcelDateMember]
        //public string DriverName { get; set; }

        ///// <summary>
        ///// 司机电话
        ///// </summary>
        //[DisplayName(displayName: "电话")]
        //[ExcelDateMember]
        //public string DriverPhone { get; set; }

        /// <summary>
        /// 配送日期
        /// </summary>
        [DisplayName(displayName: "配送日期")]
        [ExcelDateMember]
        public DateTime DistributionDate { get; set; }

        /// <summary>
        /// 应送
        /// </summary>
        [DisplayName(displayName: "应送")]
        [ExcelDateMember]
        public int ShouldSend { get; set; }

        /// <summary>
        /// 实送
        /// </summary>
        [DisplayName(displayName: "实送")]
        [ExcelDateMember]
        public int ActualSnd { get; set; }

        /// <summary>
        /// 实送比例
        /// </summary>
        [DisplayName(displayName: "实送率")]
        [ExcelDateMember]
        public string Proportion { get { return (Convert.ToDouble(ActualSnd) / Convert.ToDouble(ShouldSend)).ToString("0.00%"); } }
    }


    public class DriverActualRatioTotalDto
    {
        /// <summary>
        /// 应送
        /// </summary>
        public int TotalShouldSend { get; set; }

        /// <summary>
        /// 实送
        /// </summary>
        public int TotalActualSnd { get; set; }

        /// <summary>
        /// 实送比例
        /// </summary>
        public string TotalProportion { get { return (Convert.ToDouble(TotalActualSnd) / Convert.ToDouble(TotalShouldSend)).ToString("0.00%"); } }

        public IPagedList<DriverActualRatioOutputDto> DriverActualRatioPagedList { get; set; }
    }
}
